#include "mainwindow.h"
#include "appglobal.h"
#include "ydexception.h"
#include <QApplication>
#include <QMessageBox>

int main(int argc, char* argv[]) {
    QApplication a(argc, argv);
    MainWindow w;
    int ret = 0;

    try {
        g.initialize();
        w.show();
        ret = a.exec();
        g.uninitialize();
    } catch(YDException& e) {
        QMessageBox box(QMessageBox::Critical, "错误", e.what());
        box.exec();
    }

    return ret;
}
